﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.TemplateMethod.Interest
{
    /// <summary>
    /// 普通类
    /// </summary>
    public class VirtualMethod
    {
        /// <summary>
        /// 虚方法
        /// </summary>
        public virtual void Show()
        {
            Console.WriteLine($"{nameof(VirtualMethod)}");
        }
    }

    /// <summary>
    /// 普通类的子类
    /// </summary>
    public class ChildVirtualMethod : VirtualMethod
    {
        /// <summary>
        /// 覆写虚方法
        /// </summary>
        public override void Show()
        {
            Console.WriteLine($"{nameof(ChildVirtualMethod)}");
        }
    }
}
